package Demo1;

//定义一个动物类，作为父类
public class Animal {

    //属性
    public String name;
    public int age;
    public String weight;
    public String color;
    public String brand;


    //方法


    public void setAge(int age) {
        this.age = age;
    }
    public void printAge()
    {
        System.out.println(name + ": " + age + "岁");
    }
    public  void eat(){
        System.out.println(name + "正在吃饭....");
    }
    public void sleep(){
        System.out.println(name + "正在睡觉....");
    }
    public  void hunt(){
        System.out.println(name + "正在狩猎....");
    }

}
